package com.ys.nms.module.business.dal.mysql.processors;

import java.util.*;

import com.ys.nms.framework.common.pojo.PageResult;
import com.ys.nms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ys.nms.framework.mybatis.core.mapper.BaseMapperX;
import com.ys.nms.module.business.dal.dataobject.processors.ProcessorsDO;
import org.apache.ibatis.annotations.Mapper;
import com.ys.nms.module.business.controller.admin.processors.vo.*;

/**
 * 处理器 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ProcessorsMapper extends BaseMapperX<ProcessorsDO> {

    default PageResult<ProcessorsDO> selectPage(ProcessorsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProcessorsDO>()
                .eqIfPresent(ProcessorsDO::getEntPhysicalIndex, reqVO.getEntPhysicalIndex())
                .eqIfPresent(ProcessorsDO::getHrDeviceIndex, reqVO.getHrDeviceIndex())
                .eqIfPresent(ProcessorsDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(ProcessorsDO::getProcessorOid, reqVO.getProcessorOid())
                .eqIfPresent(ProcessorsDO::getProcessorIndex, reqVO.getProcessorIndex())
                .eqIfPresent(ProcessorsDO::getProcessorType, reqVO.getProcessorType())
                .orderByDesc(ProcessorsDO::getProcessorType));
    }

}